{extend name="base" /}
{block name="body"}

<div class="am-padding am-padding-bottom-0">
	<strong class="am-text-primary am-text-lg">广告管理</strong> / <small>编辑</small>
</div>

<div class="am-padding am-btn-toolbar">
	<div class="am-btn-group am-btn-group-xs">
		<a href="{:url('admin/Adv/index')}" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 列表</a>
		<a href="{:url('admin/Adv/add')}" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 新增</a>
		<button type="button" class="am-btn am-btn-default"><span class="am-icon-trash-o"></span> 删除</button>
	</div>
</div>

<form class="am-form"  action="{:url('admin/Adv/edit')}" method="post">
	<input type="hidden" name="id" value="{$info.id}">
	<fieldset>

		<div class="am-form-group">
			<div class="am-input-group">
				<span class="am-input-group-label">所属广告位</span>
				<select name="adv_position_id" class="am-form-field">
					{foreach name="adv_position_list" item="vo"}
					<option value="{$vo.id}" {eq name="$info.adv_position_list" value="$vo.id"}selected{/eq}>{$vo.name}</option>
					{/foreach}
				</select>
			</div>
		</div>


		<div class="am-form-group">
			<div class="am-input-group">
				<span class="am-input-group-label">标题</span>
				<input type="text" name="name" value="{$info.name}" class="am-form-field" placeholder="请输入广告标题">
			</div>
		</div>


		<div class="am-form-group am-form-file">

			<div class="am-input-group">
				<span class="am-input-group-label">预览</span>
				<div class="am-form-image">
					<img {empty name="$info.image"}src="/static/common/images/upload.png"{else/}src="{$info.image}"{/empty} alt="upload" class="" id="view-image">
					<input type="file" class="ajax-upload-file" data-url="{:url('api/Upload/index')}" data-dir="image" data-purpose="adv" data-allowext="" data-ipt="#ipt-image" data-src="#view-image" data-thumb="false">
				</div>		
			</div>
			<div class="am-input-group">
				<span class="am-input-group-label">图片</span>
				<input type="text" name="image" value="{$info.image}" class="am-form-field" placeholder="请上传广告图片或输入图片地址" id="ipt-image">
			</div>
		</div>

		<div class="am-form-group">
			<div class="am-input-group">
				<span class="am-input-group-label">链接</span>
				<input type="text" name="url" value="{$info.url}" class="am-form-field" placeholder="请输入广告链接">
			</div>
		</div>


		<div class="am-form-group">
			<div class="am-input-group">
				<span class="am-input-group-label">描述</span>
				<textarea name="description" rows="5" placeholder="广告描述">{$info.description}</textarea>
			</div>
		</div>

		<div class="am-form-group">
			<div class="am-input-group">
				<span class="am-input-group-label">排序</span>
				<input type="number" name="sort" value="{$info.sort}" class="am-form-field">
			</div>
		</div>

		<div class="am-form-group">
			<div class="am-input-group">
				<span class="am-input-group-label">状态</span>
				<div class="am-form-field">
					<label class="am-radio-inline">
						<input type="radio" name="status" value="1" data-am-ucheck {if condition="$info.status==1"}checked{/if}> 正常
					</label>
					<label class="am-radio-inline">
						<input type="radio" name="status" value="0" data-am-ucheck {if condition="$info.status==0"}checked{/if}> 禁用
					</label>
				</div>
			</div>
		</div>
		<p><button type="reset" class="am-btn am-btn-default">重置</button> <button type="submit" lay-submit lay-filter="submit" class="am-btn am-btn-default">更新</button></p>
		
		
		
	</fieldset>
</form>


{/block}